package ae.pcfc.etks.online.common.domain;

import java.math.BigDecimal;

import javax.persistence.Column;
import javax.persistence.Embeddable;

/**
 * TTscClientCompanyRoleId entity. @author Mohtisham.Salahria
 */
@Embeddable
public class TTscClientCompanyRoleId implements java.io.Serializable {

	// Fields

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	
	private BigDecimal ccClientid;
	private String crId;

	// Constructors

	/** default constructor */
	public TTscClientCompanyRoleId() {
	}

	/** full constructor */
	public TTscClientCompanyRoleId(BigDecimal ccClientid, String crId) {
		this.ccClientid = ccClientid;
		this.crId = crId;
	}

	// Property accessors

	@Column(name = "CC_CLIENTID", nullable = false, precision = 22, scale = 0)
	public BigDecimal getCcClientid() {
		return this.ccClientid;
	}

	public void setCcClientid(BigDecimal ccClientid) {
		this.ccClientid = ccClientid;
	}

	@Column(name = "CR_ID", nullable = false, length = 10)
	public String getCrId() {
		return this.crId;
	}

	public void setCrId(String crId) {
		this.crId = crId;
	}

	public boolean equals(Object other) {
		if ((this == other))
			return true;
		if ((other == null))
			return false;
		if (!(other instanceof TTscClientCompanyRoleId))
			return false;
		TTscClientCompanyRoleId castOther = (TTscClientCompanyRoleId) other;

		return ((this.getCcClientid() == castOther.getCcClientid()) || (this
				.getCcClientid() != null
				&& castOther.getCcClientid() != null && this.getCcClientid()
				.equals(castOther.getCcClientid())))
				&& ((this.getCrId() == castOther.getCrId()) || (this.getCrId() != null
						&& castOther.getCrId() != null && this.getCrId()
						.equals(castOther.getCrId())));
	}

	public int hashCode() {
		int result = 17;

		result = 37
				* result
				+ (getCcClientid() == null ? 0 : this.getCcClientid()
						.hashCode());
		result = 37 * result
				+ (getCrId() == null ? 0 : this.getCrId().hashCode());
		return result;
	}

}